package com.spring.utils.api_v4.pojo.salary;

import com.spring.utils.api_v4.pojo.DeptInfo;
import com.spring.utils.api_v4.pojo.UserInfo;
import com.spring.utils.api_v4.pojo.salary.task.DeptWageTask;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.time.LocalDate;

/**
 * 部门工资信息
 */
@Entity
@Table(name = "tb_dept_wage")
@Getter
@Setter
@ToString
public class DeptWage {
    @Id
    private int id;             // 编号
    private String name;        //名称
    private double meritPay;    // 绩效余额
    @OneToOne
    @JoinColumn(name = "clerk_id")
    private UserInfo clerk;     // 工资员
    private LocalDate lastUpdate = LocalDate.now();   // 最后一次更新
    private String note = "无";

    public String getClerkId() {
        return clerk == null ? "" : clerk.getId();
    }
}
